package com.dc.common.controller;

import com.dc.base.utils.RequestUtil;
import com.dc.common.model.BaseModel;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


public class BaseController {

    /**
     * request对象
     */
    protected HttpServletRequest request;
    /**
     * response对象
     */
    protected HttpServletResponse response;
    /**
     * session对象
     */
    protected HttpSession session;


    /**
     * 基础Http参数设置与绑定
     * @param request
     * @param response
     * @throws Exception
     */
    @InitBinder
    public void initHttpParams(HttpServletRequest request, HttpServletResponse response) throws Exception {
        this.request = request;
        this.response = response;
        this.session = this.request.getSession();
    }

}
